package com.sl.biz.modular.cdc.dao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.biz.modular.cdc.dao.domain.entity.CdcPropertiesConfigDO;
import com.sl.biz.modular.cdc.dao.mapper.CdcPropertiesConfigMapper;
import com.sl.biz.modular.cdc.dao.service.CdcPropertiesConfigDaoService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CdcPropertiesConfigDaoServiceImpl extends ServiceImpl<CdcPropertiesConfigMapper, CdcPropertiesConfigDO> implements CdcPropertiesConfigDaoService {
    @Override
    public List<CdcPropertiesConfigDO> queryByCdcIds(List<String> cdcConfigId) {
        LambdaQueryWrapper<CdcPropertiesConfigDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.in(CdcPropertiesConfigDO::getCdcId, cdcConfigId);
        return super.list(lambdaQueryWrapper);
    }

    @Override
    public Boolean removeByCdcId(String cdcId) {
        LambdaQueryWrapper<CdcPropertiesConfigDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CdcPropertiesConfigDO::getCdcId, cdcId);
        return super.remove(lambdaQueryWrapper);
    }

    @Override
    public List<CdcPropertiesConfigDO> queryByCdcId(String cdcId) {
        LambdaQueryWrapper<CdcPropertiesConfigDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CdcPropertiesConfigDO::getCdcId, cdcId);
        return super.list(lambdaQueryWrapper);
    }
}
